using System;
using System.Collections.Generic;
using System.Reflection;
using System.Runtime.InteropServices;

using ILRuntime.CLR.TypeSystem;
using ILRuntime.CLR.Method;
using ILRuntime.Runtime.Enviorment;
using ILRuntime.Runtime.Intepreter;
using ILRuntime.Runtime.Stack;
using ILRuntime.Reflection;
using ILRuntime.CLR.Utils;
using System.Linq;

namespace ILRuntime.Runtime.Generated
{
    unsafe class huqiang_UIComposite_ScrollInfo_Binding
    {
        public static void Register(ILRuntime.Runtime.Enviorment.AppDomain app)
        {
            BindingFlags flag = BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly;
            FieldInfo field;
            Type[] args;
            Type type = typeof(huqiang.UIComposite.ScrollInfo);

            field = type.GetField("scrollType", flag);
            app.RegisterCLRFieldGetter(field, get_scrollType_0);
            app.RegisterCLRFieldSetter(field, set_scrollType_0);
            app.RegisterCLRFieldBinding(field, CopyToStack_scrollType_0, AssignFromStack_scrollType_0);
            field = type.GetField("minBox", flag);
            app.RegisterCLRFieldGetter(field, get_minBox_1);
            app.RegisterCLRFieldSetter(field, set_minBox_1);
            app.RegisterCLRFieldBinding(field, CopyToStack_minBox_1, AssignFromStack_minBox_1);
            field = type.GetField("Slider", flag);
            app.RegisterCLRFieldGetter(field, get_Slider_2);
            app.RegisterCLRFieldSetter(field, set_Slider_2);
            app.RegisterCLRFieldBinding(field, CopyToStack_Slider_2, AssignFromStack_Slider_2);
            field = type.GetField("Size", flag);
            app.RegisterCLRFieldGetter(field, get_Size_3);
            app.RegisterCLRFieldSetter(field, set_Size_3);
            app.RegisterCLRFieldBinding(field, CopyToStack_Size_3, AssignFromStack_Size_3);
            field = type.GetField("ElementSize", flag);
            app.RegisterCLRFieldGetter(field, get_ElementSize_4);
            app.RegisterCLRFieldSetter(field, set_ElementSize_4);
            app.RegisterCLRFieldBinding(field, CopyToStack_ElementSize_4, AssignFromStack_ElementSize_4);

            app.RegisterCLRMemberwiseClone(type, PerformMemberwiseClone);

            app.RegisterCLRCreateDefaultInstance(type, () => new huqiang.UIComposite.ScrollInfo());
            app.RegisterCLRCreateArrayInstance(type, s => new huqiang.UIComposite.ScrollInfo[s]);


        }

        static void WriteBackInstance(ILRuntime.Runtime.Enviorment.AppDomain __domain, StackObject* ptr_of_this_method, IList<object> __mStack, ref huqiang.UIComposite.ScrollInfo instance_of_this_method)
        {
            ptr_of_this_method = ILIntepreter.GetObjectAndResolveReference(ptr_of_this_method);
            switch(ptr_of_this_method->ObjectType)
            {
                case ObjectTypes.Object:
                    {
                        __mStack[ptr_of_this_method->Value] = instance_of_this_method;
                    }
                    break;
                case ObjectTypes.FieldReference:
                    {
                        var ___obj = __mStack[ptr_of_this_method->Value];
                        if(___obj is ILTypeInstance)
                        {
                            ((ILTypeInstance)___obj)[ptr_of_this_method->ValueLow] = instance_of_this_method;
                        }
                        else
                        {
                            var t = __domain.GetType(___obj.GetType()) as CLRType;
                            t.SetFieldValue(ptr_of_this_method->ValueLow, ref ___obj, instance_of_this_method);
                        }
                    }
                    break;
                case ObjectTypes.StaticFieldReference:
                    {
                        var t = __domain.GetType(ptr_of_this_method->Value);
                        if(t is ILType)
                        {
                            ((ILType)t).StaticInstance[ptr_of_this_method->ValueLow] = instance_of_this_method;
                        }
                        else
                        {
                            ((CLRType)t).SetStaticFieldValue(ptr_of_this_method->ValueLow, instance_of_this_method);
                        }
                    }
                    break;
                 case ObjectTypes.ArrayReference:
                    {
                        var instance_of_arrayReference = __mStack[ptr_of_this_method->Value] as huqiang.UIComposite.ScrollInfo[];
                        instance_of_arrayReference[ptr_of_this_method->ValueLow] = instance_of_this_method;
                    }
                    break;
            }
        }


        static object get_scrollType_0(ref object o)
        {
            return ((huqiang.UIComposite.ScrollInfo)o).scrollType;
        }

        static StackObject* CopyToStack_scrollType_0(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.UIComposite.ScrollInfo)o).scrollType;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_scrollType_0(ref object o, object v)
        {
            huqiang.UIComposite.ScrollInfo ins =(huqiang.UIComposite.ScrollInfo)o;
            ins.scrollType = (huqiang.UIComposite.ScrollType)v;
            o = ins;
        }

        static StackObject* AssignFromStack_scrollType_0(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            huqiang.UIComposite.ScrollType @scrollType = (huqiang.UIComposite.ScrollType)typeof(huqiang.UIComposite.ScrollType).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)20);
            huqiang.UIComposite.ScrollInfo ins =(huqiang.UIComposite.ScrollInfo)o;
            ins.scrollType = @scrollType;
            o = ins;
            return ptr_of_this_method;
        }

        static object get_minBox_1(ref object o)
        {
            return ((huqiang.UIComposite.ScrollInfo)o).minBox;
        }

        static StackObject* CopyToStack_minBox_1(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.UIComposite.ScrollInfo)o).minBox;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_minBox_1(ref object o, object v)
        {
            huqiang.UIComposite.ScrollInfo ins =(huqiang.UIComposite.ScrollInfo)o;
            ins.minBox = (UnityEngine.Vector2)v;
            o = ins;
        }

        static StackObject* AssignFromStack_minBox_1(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            UnityEngine.Vector2 @minBox = (UnityEngine.Vector2)typeof(UnityEngine.Vector2).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)16);
            huqiang.UIComposite.ScrollInfo ins =(huqiang.UIComposite.ScrollInfo)o;
            ins.minBox = @minBox;
            o = ins;
            return ptr_of_this_method;
        }

        static object get_Slider_2(ref object o)
        {
            return ((huqiang.UIComposite.ScrollInfo)o).Slider;
        }

        static StackObject* CopyToStack_Slider_2(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.UIComposite.ScrollInfo)o).Slider;
            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static void set_Slider_2(ref object o, object v)
        {
            huqiang.UIComposite.ScrollInfo ins =(huqiang.UIComposite.ScrollInfo)o;
            ins.Slider = (System.Int32)v;
            o = ins;
        }

        static StackObject* AssignFromStack_Slider_2(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Int32 @Slider = ptr_of_this_method->Value;
            huqiang.UIComposite.ScrollInfo ins =(huqiang.UIComposite.ScrollInfo)o;
            ins.Slider = @Slider;
            o = ins;
            return ptr_of_this_method;
        }

        static object get_Size_3(ref object o)
        {
            return huqiang.UIComposite.ScrollInfo.Size;
        }

        static StackObject* CopyToStack_Size_3(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = huqiang.UIComposite.ScrollInfo.Size;
            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static void set_Size_3(ref object o, object v)
        {
            huqiang.UIComposite.ScrollInfo.Size = (System.Int32)v;
        }

        static StackObject* AssignFromStack_Size_3(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Int32 @Size = ptr_of_this_method->Value;
            huqiang.UIComposite.ScrollInfo.Size = @Size;
            return ptr_of_this_method;
        }

        static object get_ElementSize_4(ref object o)
        {
            return huqiang.UIComposite.ScrollInfo.ElementSize;
        }

        static StackObject* CopyToStack_ElementSize_4(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = huqiang.UIComposite.ScrollInfo.ElementSize;
            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static void set_ElementSize_4(ref object o, object v)
        {
            huqiang.UIComposite.ScrollInfo.ElementSize = (System.Int32)v;
        }

        static StackObject* AssignFromStack_ElementSize_4(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Int32 @ElementSize = ptr_of_this_method->Value;
            huqiang.UIComposite.ScrollInfo.ElementSize = @ElementSize;
            return ptr_of_this_method;
        }


        static object PerformMemberwiseClone(ref object o)
        {
            var ins = new huqiang.UIComposite.ScrollInfo();
            ins = (huqiang.UIComposite.ScrollInfo)o;
            return ins;
        }


    }
}
